$(document).ready(function(){
    datepickerReservation();
    searchReservation();
    datepickersInvoicesDate();
});
function datepickerReservation()
{
    $('#date').datepicker({
    showWeek: true,
    firstDay: 1
    });
}

function searchReservation()
{
    $('#searchReservation').on('click',function()
    {
        var fechaElegida = $('#date').val();
        fechaElegida = new Date(fechaElegida);
        $.post(axCalendar,{
            fechaIni : fechaElegida
        },function(data){
            $('#tableReservation').html(data)
            });
    });
}

function datepickersInvoicesDate()
{
    $('#diaIni,#diaFin').datepicker({
        dateFormat: 'yy-mm-dd'
    });
    $('#diaIni,#diaFin').click(function(){
        $('#ui-datepicker-div').css('z-index', 2);
    });

}

